﻿Imports extranet.BE
Imports extranet.DA

Public Class BCAlternativa

  Public Shared Sub Cadastrar(ByVal objBEAlternativa As BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    objDAAlternativa.Cadastra(objBEAlternativa)
  End Sub

  Public Shared Sub Atualizar(ByVal objBEAlternativa As BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    objDAAlternativa.Atualiza(objBEAlternativa)
  End Sub

  Public Shared Sub Excluir(ByVal objBEAlternativa As BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    objDAAlternativa.Exclui(objBEAlternativa)
  End Sub

  Public Shared Function Selecionar(ByVal intIdAlternativa As Integer) As List(Of BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa()
    Dim objBEAlternativa As New BEAlternativa(intIdAlternativa)
    Return objDAAlternativa.Seleciona(objBEAlternativa)
  End Function

  Public Shared Function Selecionar(ByVal strTexto As String, ByVal intQuestaoId As Integer, _
                                    ByVal sortExpression As String, ByVal sortDirection As String) As List(Of BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    Dim objBEAlternativa As New BEAlternativa

    objDAAlternativa.objQuery.Sort = New BESort(sortExpression, sortDirection)
    objBEAlternativa.Texto = strTexto
    objBEAlternativa.QuestaoId = intQuestaoId
    Return objDAAlternativa.Seleciona(objBEAlternativa)
  End Function

  Public Shared Function SelecionarRespostaQuestao(ByVal intIdCandidato As Integer, ByVal intIdProva As Integer, _
                                                   ByVal intIdQuestao As Integer) As List(Of BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.SelecionarRespostaQuestao(intIdCandidato, intIdProva, intIdQuestao)
  End Function

  Public Shared Function SelecionarRespostaDissertativa(ByVal intIdCandidato As Integer, ByVal intIdProva As Integer, _
                                                        ByVal intIdQuestao As Integer) As String
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.SelecionarRespostaDissertativa(intIdCandidato, intIdProva, intIdQuestao)
  End Function

  Public Shared Function StatusRespostaDissertativa(ByVal intIdCandidato As Integer, ByVal intIdProva As Integer, _
                                                    ByVal intIdQuestao As Integer) As Integer
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.StatusRespostaDissertativa(intIdCandidato, intIdProva, intIdQuestao)
  End Function

  Public Shared Function SelecionarRespostaQuestao(ByVal strAluno As String, ByVal intIdProva As Integer, _
                                                   ByVal intIdQuestao As Integer) As List(Of BEAlternativa)
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.SelecionarRespostaQuestao(strAluno, intIdProva, intIdQuestao)
  End Function

  Public Shared Function SelecionarRespostaDissertativa(ByVal strAluno As String, ByVal intIdProva As Integer, _
                                                        ByVal intIdQuestao As Integer) As String
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.SelecionarRespostaDissertativa(strAluno, intIdProva, intIdQuestao)
  End Function

  Public Shared Function StatusRespostaDissertativa(ByVal strAluno As String, ByVal intIdProva As Integer, _
                                                    ByVal intIdQuestao As Integer) As Integer
    Dim objDAAlternativa As New DAAlternativa
    Return objDAAlternativa.StatusRespostaDissertativa(strAluno, intIdProva, intIdQuestao)
  End Function

End Class